package com.jkdz.spyke.rs
{
	import com.jkgh.remedy.core.client.*;
	import flash.utils.ByteArray;

	public class FileInfo implements RemedyDataObject
	{
		public var id:String;
		public var length:int;
		public var name:String;

		public function FileInfo(id:String = null, length:int = 0, name:String = null)
		{
			this.id = id;
			this.length = length;
			this.name = name;
		}

		public function writeWithGraph(connection:RemedyClientServerConnection, graph:Vector.<Object>):void
		{
			RemedyCodec.writeClassID(connection.getSocket(), 73);
			RemedyStringClassManager.INSTANCE.writeWithGraph(id, connection, graph);
			RemedyIntegerClassManager.INSTANCE.writeWithGraph(length, connection, graph);
			RemedyStringClassManager.INSTANCE.writeWithGraph(name, connection, graph);
		}

		public static function readWithGraph(connection:RemedyClientServerConnection, graph:Vector.<Object>):Object
		{
			var id:String = (String)(RemedyStringClassManager.INSTANCE.readWithGraph(connection, graph));
			var length:int = (int)(RemedyIntegerClassManager.INSTANCE.readWithGraph(connection, graph));
			var name:String = (String)(RemedyStringClassManager.INSTANCE.readWithGraph(connection, graph));
			var ret:FileInfo = new FileInfo(id, length, name);
			return ret;
		}
	}
}
